package ajaxservlet;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import uws.UWSException;

/** 
 * Servlet implementation class datapack
 * @version $Id: ZipAsync.java 1653 2015-01-12 08:11:15Z petrol.stud@gmail.com $
 */
public class ZipAsync extends SaadaServlet  {
	private static final long serialVersionUID = 1L;

	
	/* *************************************************************** */
	/*          This class has been replaced by CartBuilder.java       */
	/*                                                                 */
	/*  ************************************************************** */
	//protected BasicUWS<ZipperJob> zipUWS = null;

	/* (non-Javadoc)
	 * @see ajaxservlet.SaadaServlet#init(javax.servlet.ServletConfig)
	 */
	public void init(ServletConfig conf) throws ServletException {
		super.init(conf);
//		try {//zipUWS = new QueuedBasicUWS<ZipperJob>(ZipperJob.class, 2, "/datapack");
////		zipUWS.setUserIdentifier(new UserIdentifier() {
////			private static final long serialVersionUID = 1L;
////			public String extractUserId(UWSUrl urlInterpreter, HttpServletRequest request) throws UWSException {
////				return request.getSession().getId();
////			}
////		});
////		zipUWS.addJobList(new JobList<ZipperJob>("zipper")); 
//		}catch(UWSException ex){
//			throw new ServletException(ex);
//		}
	}

	@Override
	public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
		try{
			printAccess(req, false);
		//	zipUWS.executeRequest(req, res);
		//	Messenger.printMsg(Messenger.TRACE, req.getSession().getId() + ": " + zipUWS.getJobList("zipper").getNbJobs()+" jobs");
		}catch(Exception ex){
			getErrorPage(req, res, ex);
		}
	}}
